package com.zhuangjie.shop.controller;

import com.zhaungjie.base.conduit.R;
import com.zhuangjie.base.constant.ModuleSecurityNames;
import com.zhuangjie.security.annotations.PublicAPI;
import com.zhuangjie.shop.service.ShopSelfPickupSerialNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhuangjie
 * @since 2023-11-28
 */
@RestController
@RequestMapping("/shop-self-pickup-serial-number")
public class ShopSelfPickupSerialNumberController {
    @Autowired
    private ShopSelfPickupSerialNumberService shopSelfPickupSerialNumberService;

    @GetMapping("/next")
    @PublicAPI(modules = {ModuleSecurityNames.USER})
    public R nextShopSelfPickupSerialNumber(@RequestParam("shopId") Long shopId) {
        return R.require(shopSelfPickupSerialNumberService.nextShopSelfPickupSerialNumber(shopId));
    }

}
